<!DOCTYPE html>
<meta charset="utf-8">
<style>
body{
  font-weight:bold;
}
.axis path, .axis line {
  fill: none;
  stroke: #000;
  shape-rendering: crispEdges;
}
</style>
<body>
<script src="../../d3.js"></script>
<script>
var width = 1000,height = 500;

var timeScale = d3.time.scale()
    .domain([new Date(2015, 0, 1), new Date(2015, 0, 10,22,59)])
    .range([0, width-80]); 
 
var origin = timeScale.copy();
//nice()
var nice=timeScale.copy().nice();
//nice(interval)
var nice_interval=timeScale.copy().nice(d3.time.week);
//nice(interval,step)
var nice_interval_step=timeScale.copy().nice(d3.time.week,2);
//nice(count)
var nice_count1=timeScale.copy().nice(1);
var nice_count100=timeScale.copy().nice(10);


var svg = d3.select("body").append("svg")
    .attr("width", width)
    .attr("height", height)
  .append("g")
    .attr("class", "axis")
    .call(d3.svg.axis().scale(origin).orient("bottom"))
  .append("g")
    .attr("class", "axis")
    .attr("transform", "translate(" + 0 + "," + height/8 + ")")
    .call(d3.svg.axis().scale(nice).orient("bottom"))
   .append("g")
    .attr("class", "axis")
    .attr("transform", "translate(" + 0 + "," + height/4 + ")")
    .call(d3.svg.axis().scale(nice_interval).orient("bottom"))
   .append("g")
    .attr("class", "axis")
    .attr("transform", "translate(" + 0 + "," + height/8 + ")")
    .call(d3.svg.axis().scale(nice_interval_step).orient("bottom"))
   .append("g")
    .attr("class", "axis")
    .attr("transform", "translate(" + 0 + "," + height/4 + ")")
    .call(d3.svg.axis().scale(nice_count1).orient("bottom"))
   .append("g")
    .attr("class", "axis")
    .attr("transform", "translate(" + 0 + "," + height/8 + ")")
    .call(d3.svg.axis().scale(nice_count100).orient("bottom"));
</script>